Actually, keep "member" message the same and add "removable" message. List out the...
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 30 Dec 2007 23:42:48 +0000 (23:42 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 30 Dec 2007 23:42:48 +0000 (23:42 +0000)
includes/SpecialUserrights.php
languages/messages/MessagesEn.php

index 5dfe4da..0394b7d 100644 (file)
@@ -70,7 +70,7 @@ class UserrightsForm extends HTMLForm {
                                $reason = $this->mRequest->getVal( 'user-reason' );
                                if( $wgUser->matchEditToken( $this->mRequest->getVal( 'wpEditToken' ), $username ) ) {
                                        $this->saveUserGroups( $username,
-                                               $this->mRequest->getArray( 'member' ),
+                                               $this->mRequest->getArray( 'removable' ),
                                                $this->mRequest->getArray( 'available' ),
                                                $reason );
                                }
@@ -269,7 +269,12 @@ class UserrightsForm extends HTMLForm {
                global $wgOut, $wgUser;
                
                list( $addable, $removable ) = $this->splitGroups( $groups );
-
+               
+               $list = array();
+               foreach( $user->getGroups() as $group )
+                       $list[] = self::buildGroupLink( $group );
+               $grouplist = implode( ', ', $list );
+               
                $wgOut->addHTML(
                        Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->action, 'name' => 'editGroup' ) ) .
                        Xml::hidden( 'user-editname', $user->getName() ) .
@@ -278,6 +283,7 @@ class UserrightsForm extends HTMLForm {
                        Xml::element( 'legend', array(), wfMsg( 'userrights-editusergroup' ) ) .
                        wfMsgExt( 'editinguser', array( 'parse' ),
                                wfEscapeWikiText( $user->getName() ) ) .
+                       '<p>' . wfMsgHtml('userrights-groupsmember') . ' ' . $grouplist . '</p>' .
                        $this->explainRights() .
                        "<table border='0'>
                        <tr>
@@ -314,6 +320,19 @@ class UserrightsForm extends HTMLForm {
                        Xml::closeElement( 'form' ) . "\n"
                );
        }
+       
+       /**
+        * Format a link to a group description page
+        *
+        * @param string $group
+        * @return string
+        */
+       private static function buildGroupLink( $group ) {
+               static $cache = array();
+               if( !isset( $cache[$group] ) )
+                       $cache[$group] = User::makeGroupLinkHtml( $group, User::getGroupMember( $group ) );
+               return $cache[$group];
+       }
 
        /**
         * Prepare a list of groups the user is able to add and remove
@@ -343,7 +362,7 @@ class UserrightsForm extends HTMLForm {
         * @return string XHTML <select> element
         */
        private function removeSelect( $groups ) {
-               return $this->doSelect( $groups, 'member' );
+               return $this->doSelect( $groups, 'removable' );
        }
 
        /**
@@ -360,7 +379,7 @@ class UserrightsForm extends HTMLForm {
         * Adds the <select> thingie where you can select what groups to add/remove
         *
         * @param array  $groups The groups that can be added/removed
-        * @param string $name   'member' or 'available'
+        * @param string $name   'removable' or 'available'
         * @return string XHTML <select> element
         */
        private function doSelect( $groups, $name ) {
@@ -483,4 +502,4 @@ class UserrightsForm extends HTMLForm {
                $viewer->showList( $output );
        }
        
-}
\ No newline at end of file
+}
index 8a463ce..861f080 100644 (file)
@@ -1330,7 +1330,8 @@ containing all of the search terms will appear in the result).",
 'editusergroup'               => 'Edit User Groups',
 'userrights-editusergroup'    => 'Edit user groups',
 'saveusergroups'              => 'Save User Groups',
-'userrights-groupsmember'     => 'Removable groups:',
+'userrights-groupsmember'     => 'Member of:',
+'userrights-groupsremovable'  => 'Removable groups:',
 'userrights-groupsavailable'  => 'Available groups:',
 'userrights-groupshelp'       => 'Select groups you want the user to be removed from or added to.
 Unselected groups will not be changed. You can deselect a group with CTRL + Left Click',